#!/user/bin/env node

const Dog = require('./02-dog.js');

let pengpeng = new Dog('pengpeng', 4),
    huihui = new Dog('huihui',6);

pengpeng.on('bark',onBark);
huihui.on('bark',onBark);

function onBark(){
  console.log(`${this.name}:barked! enery:${this.energy}`);
}

